From 6f338af1e1461e2ebfe0528e7a1b5a5fbe12e8fe Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 27 May 2011 15:49:24 +0100 Subject: [PATCH] Clean up stdarg handling a little. Fix for NetBSD. Signed-off-by: Keir Fraser --- xen/common/libelf/libelf-loader.c | 2 -- xen/common/libelf/libelf-private.h | 1 + xen/common/vsprintf.c | 1 - xen/include/xen/stdarg.h | 5 +++++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/xen/common/libelf/libelf-loader.c b/xen/common/libelf/libelf-loader.c index 69871e5aed..1ccf7d35a6 100644 --- a/xen/common/libelf/libelf-loader.c +++ b/xen/common/libelf/libelf-loader.c @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include - #include "libelf-private.h" /* ------------------------------------------------------------------------ */ diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h index e47ff3b8cd..3ef753c1b3 100644 --- a/xen/common/libelf/libelf-private.h +++ b/xen/common/libelf/libelf-private.h @@ -40,6 +40,7 @@ #else /* !__XEN__ */ +#include #include #include #include diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c index 8fd1ac25de..d9128e1691 100644 --- a/xen/common/vsprintf.c +++ b/xen/common/vsprintf.c @@ -16,7 +16,6 @@ * - scnprintf and vscnprintf */ -#include #include #include #include diff --git a/xen/include/xen/stdarg.h b/xen/include/xen/stdarg.h index 9508bc4df4..f26fa54663 100644 --- a/xen/include/xen/stdarg.h +++ b/xen/include/xen/stdarg.h @@ -1,5 +1,10 @@ #if defined(__OpenBSD__) # include "/usr/include/stdarg.h" +#elif defined (__NetBSD__) + typedef __builtin_va_list va_list; +# define va_start(ap, last) __builtin_stdarg_start((ap), (last)) +# define va_end(ap) __builtin_va_end(ap) +# define va_arg __builtin_va_arg #else # include #endif -- 2.30.2